package com.flute.datareceiver.data.unit.test;

import java.io.File;

import com.flute.tools.timer.FlexTimer;

public class DataReciveTimer {
	private HttpPostTestIndex index;
	private static final String Dir = "E:\\安装软件\\data\\baksong\\song1.xml";

	public DataReciveTimer(HttpPostTestIndex idx) {
		this.index = idx;
	}

	public static void main(String[] args) {
		HttpPostTestIndex hpti = new HttpPostTestIndex();
		DataReciveTimer timer = new DataReciveTimer(hpti);
		timer.startPost();
	}

	public void startPost() {
		File filedir = new File(Dir);
		Class[] clazz = new Class[1];
		clazz[0] = File.class;
		if (filedir.isDirectory()) {
			File[] files = filedir.listFiles();
			for (File f : files) {
				FlexTimer.getInstance().startTimer("index", index,
						"postFileToRemote", clazz, new Object[] { f }, 10000L,
						true);
			}
		} else {
			FlexTimer.getInstance().startTimer("index", index,
					"postFileToRemote", clazz, new Object[] { filedir },
					10000L, true);
		}

	}
}
